
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sj" tagdir="/WEB-INF/tags/spring-jquery-tags"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<link href="<c:url value='/css/cipe-ver2.css' />"	rel="stylesheet" type="text/css" />
<link href="<c:url value='/css/dhtmlxcombo_paylineitem.css' />"	rel="stylesheet" type="text/css" />

<div id="activeProjectQueryInput" style="border: solid black; background-color:#ffffff; padding-bottom:10px; font-size:100%; text-align:left;">
	
	<div  class="form_head">
	  <label style="font-size: 14px"><b>Project List (Active) input criteria :			
				</b> </label>
		<div class="floatR">
		  			<input type="image" src="<c:url value='/images/cross-button.jpg'/>" onClick="javascript:clearDiv()"/>				  
		</div>
	
   	</div>
   
   	<br/>
		<form:form name="activeProjectQueryForm" id="activeProjectQueryForm" target="_blank" action="showActiveProjectsPdf.do" modelAttribute="activeProjectListQuery" method="post">
		<table cellpadding="0" cellspacing="4" border="0" align="center" >
			<tr>
				<td class="label">
					Status :
				</td>
					<td class="input-field" colspan="2">
					<form:select path="statusName" id="projectStatusId"								
								cssClass="input-full-width text_white" tabindex="1">
								<form:option value="" label="Select" />
								<form:options items="${cipeprojectstatusList}" itemValue="displayName"
									itemLabel="displayName" />
					 </form:select> 
				</td>
				
			</tr>
			
			<tr>
				<td class="label">
					Region :
				</td>
					<td class="input-field" colspan="2">
					<form:select path="regionName" id="regionId"								
								cssClass="input-full-width text_white" tabindex="1">
								<form:option value="" label="Select" />
								<form:options items="${regionList}" itemValue="displayName"
									itemLabel="displayName" />
					 </form:select> 
				</td>
			
			</tr>
			<tr>
				<td class="label">
					Donor Name :
				</td>
					<td class="input-field" colspan="2">
					<form:select path="donorName" id="donorId"
								
								cssClass="input-full-width text_white" tabindex="1">
								<form:option value="" label="Select" />
								<form:options items="${donorList}" itemValue="donorName"
									itemLabel="donorName" />
					 </form:select> 
				</td>
				
			</tr>
			<tr>
				<td class="label">
					Donor Award Number :
				</td>
				<td class="input-field">
				<form:select  id="donorAwardId" path="donorAwardNumber"								
								cssClass="input-full-width text_white" tabindex="1">
								<form:option value="" label="Select" />
								<form:options items="${donorawardList}"  itemValue="fullDonorawardNumber" itemLabel="fullDonorawardNumber" />
					 </form:select> 
					
				</td>
			</tr>
			<tr>
				<td class="label">
					Program Officer :
				</td>
					<td class="input-field" colspan="2">
					<form:select path="programOfficer" id="programOfficerId"								
								cssClass="input-full-width text_white" tabindex="1">
								<form:option value="" label="Select" />
								<form:options items="${programOfficerList}" itemValue="fullName"
									itemLabel="fullName" />
					 </form:select> 
				</td>
			
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td class="label">
					<input id="activeProjectQuerySubmit" type="submit" value="Show Report"/>
				</td>
			</tr>
		</table>
	</form:form>
</div>
<script type="text/javascript">
	function clearDiv() {
		Popup.hide('activeProjectQueryInput1');
		 $('#activeProjectQueryInput1').html("");
	}
	$(document).ready(function() {
		$('.dhx_combo_input').focus(function(){
			 if($(this).val()=="Select")
				 $(this).val("");
		});
		});
			var z1 = dhtmlXComboFromSelect("donorId",274);
			z1.enableFilteringMode(true);
			z1.DOMelem_input.style.backgroundColor = "white";	
			z1.attachEvent("onChange",function(){
			 	if(z1.getComboText()==null || z1.getComboText()=="Select" || z1.getComboText()=="")
			 		{
			 		 z2.setComboValue("");
			 		 z2.setComboText("Select");
			 		 z2.clearAll();
	                 z2.addOption("","Select",274);
			 		}
			 	else{	
				 	loadDataViaAjax("showDonorawardByDonor.do", {
			 			"id" : z1.getSelectedValue()
			 		}, parseDonorAwardJson);
			 	}
					
			 	});
			
			var z2 = dhtmlXComboFromSelect("donorAwardId",274);
			z2.enableFilteringMode(true);
			z2.DOMelem_input.style.backgroundColor = "white";		

				
			
			var z4 = dhtmlXComboFromSelect("regionId",274);
			z4.enableFilteringMode(true);
			z4.DOMelem_input.style.backgroundColor = "white";
			
			var z5 = dhtmlXComboFromSelect("programOfficerId",274);
			z5.enableFilteringMode(true);
			z5.DOMelem_input.style.backgroundColor = "white";	
			
			var z6 = dhtmlXComboFromSelect("projectStatusId",274);
			z6.enableFilteringMode(true);
			z6.DOMelem_input.style.backgroundColor = "white";		

			function parseDonorAwardJson(data) {
				z2.clearAll();
				if (data) {
					z2.setComboValue("");
					z2.setComboText("Select");
					for (p in data) {					
							z2.addOption(data[p],p,274);		
						}
				}			
			}
	
</script>
